package com.demo.enums;
/**
 * 1 医生  2 护士  3 其他
 */
public enum UserTypeEnum {
    DOCTOR(1, "医生"),
    NURSE(2, "护士"),
    OTHER(3, "其他");

    private int value;
    private String desc;

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    UserTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static UserTypeEnum getByValue(Integer value) {
        for (UserTypeEnum item : values()) {
            if (item.getValue() == value) {
                return item;
            }
        }
        return null;
    }
}
